package com.yeyks.other.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeyks.common.exception.ServiceException;
import com.yeyks.other.dal.dao.RecruitmentOfCityPartnersMapper;
import com.yeyks.other.dal.domain.RecruitmentOfCityPartners;
import com.yeyks.other.pojo.param.RecruitmentOfCityPartnersAddParam;
import com.yeyks.other.service.RecruitmentOfCityPartnersService;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 城市合伙人大招募 服务实现类
 * </p>
 *
 * @author yun
 * @since 2020-02-24
 */
@Service
public class RecruitmentOfCityPartnersServiceImpl extends ServiceImpl<RecruitmentOfCityPartnersMapper, RecruitmentOfCityPartners> implements RecruitmentOfCityPartnersService {

    @Override
    public void add(RecruitmentOfCityPartnersAddParam param) {
        RecruitmentOfCityPartners recruitmentOfCityPartners = BeanUtil.toBean(param, RecruitmentOfCityPartners.class);
        if (!save(recruitmentOfCityPartners)){
            throw new ServiceException("申请失败,请重试");
        }
    }

}
